package com.itheima.wsdemo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SendMsgController {


    @GetMapping("/send/{clientId}/{msg}")
    public String send(@PathVariable("clientId")String clientId,
                       @PathVariable("msg")String msg) throws Exception{
        WebSocketServer.sendMessageToClient(msg, clientId);
        return "success";
    }
}
